'use strict';
import React, {Component, PropTypes} from 'react';
import { connect } from 'react-redux';
import { Button,Row, Col, Table, Alert } from 'antd';
import MainArea from '../../components/common/mainArea'
import { meInfo } from '../../reducers/me/actions.js';
import './style.less';
class Screen extends Component {
    constructor(props) {
        super(props);
        this.state = {
            selectedRowKeys:[]
        };
        this.props.meInfo();
    }

    render() {
        let { info } = this.props.me;
        if(!info) return null;
        return (
            <MainArea title="帐户信息" left="0">
                <div style={{ marginTop:16,marginBottom: 16 }}>
                    <div className="pt f14">
                        <div className="box">
                            <div className="box_hed">
                                <h3>个人信息</h3>
                            </div>
                            <div className="box_bod">
                                <Row className="box_row">
                                    <Col span="3" className="box_label">手机号:</Col>
                                    <Col span="19">{info.mobile}</Col>
                                </Row>
                                <Row className="box_row">
                                    <Col span="3" className="box_label">邮箱:</Col>
                                    <Col span="19">{info.email}</Col>
                                </Row>
                                <Row className="box_row">
                                    <Col span="3"  className="box_label">角色:</Col>
                                    <Col span="19">{
                                        info.creator ?
                                            "创建者":"用户"
                                    }</Col>
                                </Row>
                            </div>
                        </div>
                    </div>
                </div>
            </MainArea>
        )
    }
}

export default connect(
    state =>{
        return {
            common: state.common,
            user:state.user,
            me:state.me
        };
    },
    dispatch => {
        return {
            meInfo: ()=>{ dispatch( meInfo() ) },
        }
    }
)(Screen);